<?php
$objRequest 	= $this->_request;
$strController 	= $objRequest->getControllerName();
$strAction 		= $objRequest->getActionName();
$AppUI			= Zend_Registry::get('AppUI');
$objCache		= Zend_Registry::get('objCache');
$strFileHeader	= ROOT_DIR . '/frontend/controllers/common/' . $strController . '.header.php';
$strMessage		= ROOT_DIR . '/messages/frontend/' . $strController . '.php';
if(file_exists($strFileHeader)) {
	include_once($strFileHeader);
}
if(file_exists($strMessage)) {
	include_once($strMessage);
}
if (isset($_COOKIE[COOKIE_VFRIEND_AUTH]) && $_COOKIE[COOKIE_VFRIEND_AUTH] != '' && $AppUI->id == 0) {
	$arrCookieAuth 		= explode('::', Vfriend_Function::base64D($_COOKIE[COOKIE_VFRIEND_AUTH]));
	$strEmail 			= $arrCookieAuth[0];
	$intPasswordLength 	= $arrCookieAuth[2];
	$intLogin			= isset($arrCookieAuth[3]) ? $arrCookieAuth[3] : 0;
	if($intLogin == 0) {
		$strPassword		= '';
		for($i=0;$i<$intPasswordLength;$i++) {
			$strPassword .= '*';
		}
		$this->view->ckEmail	= $strEmail;
		$this->view->ckPassword	= $strPassword;
		$this->view->ckRemember	= 1;
	}
}
if($AppUI->id > 0 ) {	
	$objVfriendUser			= new Vfriend_User();
	$objURequest			= new URequest();
	$objNotification		= new Notification();
	$this->view->intVon		= $objVfriendUser->getAccount($AppUI->id, 1);
	$this->view->intRnoRe	= $objURequest->getUnread($AppUI->id);
	$this->view->intRnoNo	= $objNotification->getNotifyUnread($AppUI->id);
	
}
$this->view->ROOT_DIR 		= ROOT_DIR;
$this->view->strController 	= $strController;
$this->view->strAction 		= $strAction;
$this->view->arrCSS 		= isset($arrCSS) ? $arrCSS : null;
$this->view->arrJSBefore 	= isset($arrJSBefore) ? $arrJSBefore : null;
$this->view->arrJS 			= isset($arrJS) ? $arrJS : null;
$this->view->arrError		= isset($arrError) ? $arrError : null;
$this->view->strMsg			= Vfriend_Function::getMsg();
$this->view->strError		= Vfriend_Function::getError();
$this->view->strBrowser		= Vfriend_Function::getBrowser();
?>